//左侧
Vue.component("floor_cate", {
    template: `<div class="cate fl">
                <h2>{{floor_name}}</h2>
                <div class="cate_wrap">
                    <ul>
                    
                        <li v-for="sub in sub_categorys"><a :href="sub.id"><b>.</b>{{sub.cat_name}}</a></li>
                    </ul>
                    <p><a href="left_ad.link"><img :src="left_ad.img" alt=""/></a></p>
                </div>
            </div>`,

    props: ['floor_name', 'sub_categorys', 'left_ad'],

    data() {
        return {}

    },
    created() {

    },
    methods: {}
})
//主体
Vue.component("floor_goodslist", {
    template: ` 
 <div class="goodslist fl">
                <h2>
                    <span class="on">推荐商品</span>
                    <span class v-for="v in rec_categorys">{{v.cat_name}}</span>    
                </h2>
                <div class="goodslist_wrap">
                    <div>
                        <ul>
                            <li v-for="(v,k) in rec_goods">
                                <dl>
                                    <dt><a :href="'goods.html?id='+v.id"><img :src="v.logo" alt=""/></a></dt>
                                    <dd><a :href="'goods.html?id='+v.id">{{v.goods_name}}</a></dd>
                                    <dd><span>售价：</span> <strong>{{v.price}}</strong></dd>
                                </dl>
                            </li>
                        </ul>
                    </div>
                    <div v-for="v in rec_categorys" class="none">
                        <ul>
                         <li v-for="(good,k) in v.rec_goods">
                                <dl>
                                    <dt><a :href="'goods.html?id='+v.id"><img :src="good.logo" alt=""/></a></dt>
                                    <dd><a :href="'goods.html?id='+v.id">{{good.goods_name}}</a></dd>
                                    <dd><span>售价：</span> <strong>{{good.price}}</strong></dd>
                                </dl>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
 `,
    props: ['rec_goods', 'rec_categorys'],
    data() {
        return {
            goods: []

        }
    },
    created() {
        getRecommendGoods().then(res => {
            this.goods = res.data.data;
        })
    },

    methods: {}
})
// 更多品牌
Vue.component("floor_brand", {
    template: ` <div class="brand">
                <h2><a href="">更多品牌&nbsp;></a><strong>品牌旗舰店</strong></h2>
                <div class="sidebar_wrap">
                    <ul>
                        <li v-for="b in brands"><a :href="b.id"><img :src="b.logo" alt=""/></a></li>
                    </ul>
                </div>
            </div>`,
    props: ['brands'],
    data() {
        return {}

    },
    methods: {}
})

// 分类资讯
Vue.component("floor_info", {
    template: `<div class="info mt10">
                <h2><strong>分类资讯</strong></h2>
                <div class="sidebar_wrap">
                    <ul>
                        <li v-for="n in news"><a :href="n.id"><b>.</b>{{n.title}}</a></li>
                     
                    </ul>
                </div>

            </div>`,
    props: ['news'],
    data() {
        return {}

    },
    methods: {}
})

//  广告
Vue.component("floor_ads", {
    template: `<div class="ads mt10">
                    <ul>
                        <li> <a :href="right_ad.link"><img :src="right_ad.img" alt=""/></a></li>
                    </ul>
            </div>`,
    props: ['right_ad'],
    data() {
        return {}

    },

    methods: {}
})

Vue.component("floor_first", {
    template: `
  <div class="sidebar fl ml10">
            <h2><strong>网站首发</strong></h2>
           <div class="sidebar_wrap">
                <dl v-for="title in titles" class="first">
                    <dt class="fl"><a href=""><img :src="title.img" alt=""/></a></dt>
                    <dd><strong><a :href="title.link">{{title.title}}</a></strong> <em>首发</em></dd>
                    <dd>{{title.description}}</dd>
                </dl>
            </div>
        </div>`,
    data() {
        return {
            titles: []
        }
    },
    created() {
        getIndexAdTop().then(res => {
            this.titles = res.data.data;

        })
    },
    methods: {}
})
